<template>
  <el-container class="m-layout-container">
    <el-aside class="m-layout-aside" width="200px">
      <a class="m-brand">
        <svgicon height="25" name="logo" width="89" />
      </a>
      <div>
        <ul class="nav">
          <!--          <li>-->
          <!--            <router-link to="/home">-->
          <!--              <svgicon name="icon_home"></svgicon>-->
          <!--              <span>概述</span>-->
          <!--            </router-link>-->
          <!--          </li>-->
          <li>
            <router-link to="/user">
              <svgicon name="icon_user" />
              <span>用户管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/device">
              <svgicon name="icon_device" />
              <span>设备管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/company">
              <svgicon name="icon_company" />
              <span>企业管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/auth/rule">
              <svgicon name="icon_auth" />
              <span>权限管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/auth/group">
              <svgicon name="icon_job" />
              <span>角色管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/audit">
              <svgicon name="icon_audit" />
              <span>日志管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/app_version">
              <svgicon name="icon_version" />
              <span>版本管理</span>
            </router-link>
          </li>
          <li>
            <router-link to="/setting">
              <svgicon name="icon_setting" />
              <span>设置</span>
            </router-link>
          </li>
        </ul>
      </div>
    </el-aside>
    <router-view />
  </el-container>
</template>

<script>
import { mapActions } from "vuex";

export default {
  mounted() {
    this.reload().then(rs => {
      if (!rs) {
        this.$router.push("/login");
      }
    });
  },
  methods: {
    ...mapActions("profile", ["reload"])
  }
};
</script>
